_init() {
this._currentWindow = null;
- this._currentWindowPositionId = 0;
global.display.connect('notify::focus-window', () => {
this._setCurrentWindow(global.display.focus_window);
this.emit('window-changed', this._currentWindow);
});
+ global.display.connect('grab-op-begin', (display, window, op) => {
+ if (window == this._currentWindow &&
+ (op == Meta.GrabOp.MOVING || op == Meta.GrabOp.KEYBOARD_MOVING))
+ this.emit('reset');
+ });
+
/* Valid for wayland clients */
Main.inputMethod.connect('cursor-location-changed', (o, rect) => {
let newRect = { x: rect.get_x(), y: rect.get_y(), width: rect.get_width(), height: rect.get_height() };
},
_setCurrentWindow(window) {
- if (this._currentWindow)
- this._currentWindow.disconnect(this._currentWindowPositionId);
-
this._currentWindow = window;
- if (window) {
- this._currentWindowPositionId = this._currentWindow.connect('position-changed', () => {
- if (global.display.get_grab_op() != Meta.GrabOp.NONE)
- this.emit('reset');
- });
- }
},
_setCurrentRect(rect) {